$(function () {
	$.ajax({
		type: "get",
		url: DOMAIN + '/v1/Configuration' + isLogin,
		dataType: "json",
		async: true,
		success: function (result) {
			if (result.status == 200) {
				var list = result.data[0];
				$('#id').val(list.id);
				$('#conversion').val(list.conversion);
				$('#lossPrice').val(list.lossPrice);
				$('#processingPrice').val(list.processingPrice);
				$('#maxMoney').val(list.maxMoney);
				$('#minMoney').val(list.minMoney);
			}
		}
	})

})

//保存企业档案信息
$("#enter-savetBtn").click(function () {
	//var data = $("#EnterForm").serialize();
	var id = $('#id').val();
	var data = getFormJsonObject($("#EnterForm"));
	data = JSON.stringify(data);
	$.ajax({
		type: "PATCH",
		url: DOMAIN + '/v1/Configuration/' + id + isLogin,
		dataType: "JSON",
		contentType: "application/JSON; charset=utf-8",
		data: data,
		async: true,
		success: function (result) {
			if (result.status == 200) {
				alert("保存成功");
			} else {
				alert("保存失败");
			}
		}
	})
})
